<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="javabean.Conn" %>
    <%@ page import="javabean.User" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>adminShow</title>
</head>
<body>
<%
try{
	Connection conn=Conn.connect();
	String selectsql="select * from wuqiantong";
	Statement s=conn.createStatement();
	ResultSet rs=s.executeQuery(selectsql);
	List<User> list=new ArrayList<>();
	while(rs.next()){
		User user=new User();
		user.setId(rs.getInt(1));
		user.setName(rs.getString(2));
		user.setInterest(rs.getString(3));
		user.setPassword(rs.getString(4));
		list.add(user);
	}
	rs.close();
	s.close();
	conn.close();
%>
<table>
<caption>classInformation</caption>
<tr>
<th>id</th>
<th>name</th>
<th>interest</th>
<th>password</th>
</tr>

<% 
 if(list == null || list.size() < 1){
	out.print("No information.");
}
else{ 
	for (User user1: list) {
%>
<tr>
<td><%=user1.getId() %></td>
<td><%=user1.getName()%></td>
<td><%=user1.getInterest() %></td>
<td><%=user1.getPassword() %></td>
</tr>


<%
}
}
}
catch(Exception e){
	e.printStackTrace();
}
%>
</table>
<a href="adminMain.jsp">adminMain</a>
</body>
</html>